Prizm Content Connect
Preventing Automatic Scaling Up of Image Types

To prevent image files, such as JPG's or GIF's, from being scaled up to fill space in the document window, you can detect the file extension and set the automatic resize flashvar, "allowAutomaticResize" to an appropriate value. In the following JavaScript example, the code looks for a file of type ".gif" or ".jpg" and sets the auto resize flashvar to "No" if the file matches:

JavaScript Example
Copy Code
var flashvars = {
            documentname: '<%=HttpUtility.UrlEncode(origDocument) %>',
            saveDocumentLocation: 'PCC/savedocument.ashx?document=<%=HttpUtility.UrlEncode(origDocument) %>',
            showThumbnailsByDefault:'yes',
            allowAutomaticResize: 'no'
};
if(flashvars.documentname.match(/(\.gif|\.jpg)+$/)){
            flashvars.allowAutomaticResize = 'no';
} 
else {
            flashvars.allowAutomaticResize = 'yes';
}
if(swfobject.getFlashPlayerVersion().major == 0) {
            var alternateContent = ''
                + '<div id="documentviewer">\n'
                + '  The Prizm Content Connect viewer requires Adobe Flash player.\n'
                + '  <p>\n'
                + '    <a href="http://get.adobe.com/flashplayer/"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/></a>\n'
                + '  </p>\n'
                + '</div>';
            document.write(alternateContent);
}
swfobject.embedSWF("ViewerEnterpriseAnnotation.swf", "documentviewer", "800", "650", "10.0.0", false, flashvars, params, attributes);

 

 


©2014. Accusoft Corporation. All Rights Reserved.

Send Feedback